package com.szzg10.jsp.chapter10;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.SkipPageException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class SimpleTagTest6 extends SimpleTagSupport {

	private boolean thingsDontWork;

	@Override
	public void doTag() throws JspException, IOException {
		getJspContext().getOut().print("Message from within doTag().<br>");
		getJspContext().getOut().print("About to throw a SkipPageException");
		if(thingsDontWork) {
			throw new SkipPageException();
		}
	}
	
	//---getter and setter---
	public boolean isThingsDontWork() {
		return thingsDontWork;
	}

	public void setThingsDontWork(boolean thingsDontWork) {
		this.thingsDontWork = thingsDontWork;
	}
}
